package com.stu.controller.student;

import com.stu.Dto.ClassJobApplicationDTO;
import com.stu.Dto.ExcuseApplicationDTO;
import com.stu.result.Result;
import com.stu.serive.ClassInformationService;
import com.stu.serive.ExcuseApplicationService;
import com.stu.vo.ExcuseApplicationVo;
import com.stu.vo.StayApplicationVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/student")
public class ExcuseApplicationController {

    @Autowired
    private ExcuseApplicationService excuseApplicationService;

    /**
     * 添加请假申请信息
     * @return
     */
    @PostMapping("/excuseApplication")
    private Result insertExcuseApplication(@RequestBody ExcuseApplicationDTO excuseApplicationDTO){
        excuseApplicationService.insertExcuseApplication(excuseApplicationDTO);
        return Result.success();
    }

    /**
     * 查询请假申请信息
     * @return
     */
    @GetMapping("/excuseApplication")
    private Result<List<ExcuseApplicationVo>> selectStayApplication(){

        return Result.success(excuseApplicationService.selectStayApplication());
    }

}
